package com.woniu.mealsService.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import com.woniu.dto.StoreListDTO;
import com.woniu.dto.StoreProductDTO;
import com.woniu.mealsService.model.Store;
import com.woniu.mealsService.model.StoreProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

import java.util.List;

/**
 * <p>
 * 店铺菜品表 Mapper 接口
 * </p>
 *
 * @author jiang
 * @since 2024年12月10日
 */
@Mapper
public interface StoreProductMapper extends BaseMapper<StoreProduct> {
    List<StoreProductDTO> searchStoreProductList(@Param("storeProduct") StoreProduct storeProduct);

    Integer updateDiscount(@Param("storeProduct") StoreProduct storeProduct);

    Integer updateStateById(@Param("storeProduct") StoreProduct storeProduct);
    StoreProductDTO searchStoreProductDetail(@Param("productId") String productId);

    List<StoreProduct> List(List<Long> cartList);

    @Update("UPDATE store_product SET product_del=1 where store_product_id=#{storeProduct.storeProductId} and user_id=#{storeProduct.userId}")
    Integer deleteProduct(@Param("storeProduct") StoreProduct storeProduct);

    Integer updateStoreProduct(@Param("storeProduct") StoreProduct storeProduct);
    List<StoreProductDTO> searchDiscountProductList(@Param("storeId") String storeId);

    List<StoreListDTO> searchStoreByProductName(@Param("productName") String productName);
}
